<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionProperty 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionparameter.tostring.html">ReflectionParameter::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionproperty.clone.html">ReflectionProperty::__clone</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.reflectionproperty" class="reference">

 <h1 class="title">ReflectionProperty 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5)</p>


  <div class="section" id="reflectionproperty.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <strong class="classname">ReflectionProperty</strong> 类报告了类的属性的相关信息。
   </p>
  </div>


  <div class="section" id="reflectionproperty.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">ReflectionProperty</strong>
     </span>
     
     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.reflector.html" class="interfacename">Reflector</a></span>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionproperty.html#reflectionproperty.constants.is-static"><var class="varname">IS_STATIC</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionproperty.html#reflectionproperty.constants.is-public"><var class="varname">IS_PUBLIC</var></a></var>
     <span class="initializer"> = 256</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionproperty.html#reflectionproperty.constants.is-protected"><var class="varname">IS_PROTECTED</var></a></var>
     <span class="initializer"> = 512</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionproperty.html#reflectionproperty.constants.is-private"><var class="varname">IS_PRIVATE</var></a></var>
     <span class="initializer"> = 1024</span>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.reflectionproperty.html#reflectionproperty.props.name">$<var class="varname">name</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.reflectionproperty.html#reflectionproperty.props.class">$<var class="varname">class</var></a></var>
    ;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="reflectionproperty.clone.html" class="methodname">__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionproperty.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$class</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span><span class="methodname"><a href="reflectionproperty.export.html" class="methodname">export</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$class</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$return</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionClass</span><span class="methodname"><a href="reflectionproperty.getdeclaringclass.html" class="methodname">getDeclaringClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionproperty.getdoccomment.html" class="methodname">getDocComment</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionproperty.getmodifiers.html" class="methodname">getModifiers</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionproperty.getname.html" class="methodname">getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionproperty.getvalue.html" class="methodname">getValue</a></span>
    ([ <span class="methodparam"><span class="type">object</span> <code class="parameter">$object</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionproperty.isdefault.html" class="methodname">isDefault</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionproperty.isprivate.html" class="methodname">isPrivate</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionproperty.isprotected.html" class="methodname">isProtected</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionproperty.ispublic.html" class="methodname">isPublic</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionproperty.isstatic.html" class="methodname">isStatic</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="reflectionproperty.setaccessible.html" class="methodname">setAccessible</a></span>
    ( <span class="methodparam"><span class="type">bool</span> <code class="parameter">$accessible</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="reflectionproperty.setvalue.html" class="methodname">setValue</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$object</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionproperty.tostring.html" class="methodname">__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>


  </div>

  

  <div class="section" id="reflectionproperty.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="reflectionproperty.props.name"><var class="varname"><var class="varname">name</var></var></dt>

     <dd>

      <p class="para">
       属性的名称。只读，在尝试赋值的时候抛出 <a href="class.reflectionexception.html" class="classname">ReflectionException</a>。
      </p>
     </dd>

    
    
     <dt id="reflectionproperty.props.class"><var class="varname"><var class="varname">class</var></var></dt>

     <dd>

      <p class="para">
       定义的属性所在的类。只读，在尝试赋值的时候抛出 <a href="class.reflectionexception.html" class="classname">ReflectionException</a>。
      </p>
     </dd>

    
   </dl>

  </div>


  

  <div class="section" id="reflectionproperty.constants">
   <h2 class="title">预定义常量</h2>
   <div class="section" id="reflectionproperty.constants.modifiers">
    <h2 class="title">ReflectionProperty 修饰符</h2>
    <dl>


     
      <dt id="reflectionproperty.constants.is-static"><strong><code>ReflectionProperty::IS_STATIC</code></strong></dt>

      <dd>

       <p class="para">
        指示了 <a href="language.oop5.static.html" class="link">static</a> 的属性。
       </p>
      </dd>

     

     
      <dt id="reflectionproperty.constants.is-public"><strong><code>ReflectionProperty::IS_PUBLIC</code></strong></dt>

      <dd>

       <p class="para">
        指示了 <a href="language.oop5.visibility.html" class="link">public</a> 的属性。
       </p>
      </dd>

     

     
      <dt id="reflectionproperty.constants.is-protected"><strong><code>ReflectionProperty::IS_PROTECTED</code></strong></dt>

      <dd>

       <p class="para">
        指示了 <a href="language.oop5.visibility.html" class="link">protected</a> 的属性。
       </p>
      </dd>

     

     
      <dt id="reflectionproperty.constants.is-private"><strong><code>ReflectionProperty::IS_PRIVATE</code></strong></dt>

      <dd>

       <p class="para">
        指示了 <a href="language.oop5.visibility.html" class="link">private</a> 的属性。
       </p>
      </dd>

     

    </dl>

   </div>
  </div>



 </div>

 

















































































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionproperty.clone.html">ReflectionProperty::__clone</a> — Clone</li><li><a href="reflectionproperty.construct.html">ReflectionProperty::__construct</a> — Construct a ReflectionProperty object</li><li><a href="reflectionproperty.export.html">ReflectionProperty::export</a> — Export</li><li><a href="reflectionproperty.getdeclaringclass.html">ReflectionProperty::getDeclaringClass</a> — Gets declaring class</li><li><a href="reflectionproperty.getdoccomment.html">ReflectionProperty::getDocComment</a> — Gets doc comment</li><li><a href="reflectionproperty.getmodifiers.html">ReflectionProperty::getModifiers</a> — Gets modifiers</li><li><a href="reflectionproperty.getname.html">ReflectionProperty::getName</a> — Gets property name</li><li><a href="reflectionproperty.getvalue.html">ReflectionProperty::getValue</a> — Gets value</li><li><a href="reflectionproperty.isdefault.html">ReflectionProperty::isDefault</a> — Checks if default value</li><li><a href="reflectionproperty.isprivate.html">ReflectionProperty::isPrivate</a> — Checks if property is private</li><li><a href="reflectionproperty.isprotected.html">ReflectionProperty::isProtected</a> — Checks if property is protected</li><li><a href="reflectionproperty.ispublic.html">ReflectionProperty::isPublic</a> — Checks if property is public</li><li><a href="reflectionproperty.isstatic.html">ReflectionProperty::isStatic</a> — Checks if property is static</li><li><a href="reflectionproperty.setaccessible.html">ReflectionProperty::setAccessible</a> — Set property accessibility</li><li><a href="reflectionproperty.setvalue.html">ReflectionProperty::setValue</a> — Set property value</li><li><a href="reflectionproperty.tostring.html">ReflectionProperty::__toString</a> — To string</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionparameter.tostring.html">ReflectionParameter::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionproperty.clone.html">ReflectionProperty::__clone</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
